package com.itheima.docker.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.docker.pojo.Docker;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface DockerMapper extends BaseMapper<Docker> {
    @Select("select number from docker")
    int findDocekers();

    @Update("update docker set number = number+1 where url = #{ip}")
    int updateDockers(@Param("ip") String ip);

    @Insert("insert into docker values (#{ip},1)")
    int insertDockers(@Param("ip") String contextPath);

    @Select("select url from docker")
    String findDocekersBycontextPath();
}
